#include<bits/stdc++.h>
using namespace std;
struct vol
{
	long long num,mark;
}v[5005];
bool cmp(vol x,vol y)
{
	if(x.mark!=y.mark)
	return x.mark>y.mark;
	return x.num<y.num;
}
int main()
{
	long long n,m,i,line,cnt=0;
	cin>>n>>m;
	for(i=1;i<=n;i++)
	cin>>v[i].num>>v[i].mark;
	sort(v+1,v+i,cmp);
	line=v[(int)floor(m*1.5)].mark;
	for(i=1;i<=n;i++)
	if(v[i].mark>=line)
	cnt++;
	cout<<line<<" "<<cnt<<endl;
	for(i=1;i<=cnt;i++)
	cout<<v[i].num<<" "<<v[i].mark<<endl;
    return 0;
}
